package com.hmdp.mapper;

import com.hmdp.entity.Follow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@Mapper
public interface FollowMapper extends BaseMapper<Follow> {

    /**
     * 关注
     * @param followUserId
     */
    Boolean follow(Long followUserId, Long userId);

    /**
     * 取关
     * @param followUserId
     */
    Boolean unFollow(Long followUserId, Long userId);

    /**
     * 查询是否关注
     * @param followUserId
     */
    Integer isFollow(Long followUserId, Long userId);

    /**
     * 查询粉丝列表
     * @param userId
     * @return
     */
    List<Follow> selectFans(@Param("followUserId") Long userId);
}
